package com.lz.zk.example.swagger;

import java.lang.annotation.Annotation;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import com.alibaba.fastjson.JSON;

import io.swagger.annotations.Api;

@RestController
@RequestMapping("/test")
public class SwaggerExampleTest {

	@Autowired
	RequestMappingHandlerMapping mapping;

	@GetMapping("hh")
	public String SwaggerTest() {
		
		Class<SwaggerExampleController> clazz = SwaggerExampleController.class;
		//获取类方法
		
        // 获取类注解
        Annotation myClassAnnotation = clazz.getAnnotation(Api.class);
        System.out.println(JSON.toJSONString(myClassAnnotation));
		return null;
        		
	}

}
